home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Camelot
/
Camelot 075 (1990-05)(Swedish User Group of Amiga)(SE)(PD)[WB].zip
/
Camelot 075 (1990-05)(Swedish User Group of Amiga)(SE)(PD)[WB].adf
/
p2c
/
examples
/
examples.LZH
/
fact.p
< prev
next >
Wrap
Text File
|
1990-05-13
|
299b
|
28 lines
program factorials(input, output);
var
i : integer;
function fact(n : integer) : integer;
begin
if n > 1 then
fact := n * fact(n-1)
else
fact := 1;
end;
begin
for i := 1 to 10 do
writeln('The factorial of ', i:1, ' is ', fact(i):1);
end.